<section>
	<div class="page_title">
		<h2 class="fl">修改权限分类</h2>
        <a class="fr top_rt_btn iconfont iconfont-chexiao" href="{:U('admin/Auth/authCateList')}">权限分类列表</a>
	</div>

	<ul class="ulColumn2">
		{volist name='modules' id='v'}
		<input type="hidden" name="id" value="{:encrypt_id($v.id)}" />
		<li>
			<span class="item_name" style="width:120px;">分类名称：</span>
			<input type="text" name="modulename" class="textbox textbox_295" value="{$v.modulename}">
		</li>

		{/volist}
		<li>
			<span class="item_name" style="width:120px;"></span>
			<input type="submit" class="link_btn updatecate" style="margin-left: 300px">
		</li>
	</ul>
</section>
<script>
	$('.updatecate').click(function () {
		var modulename = $("input[name=modulename]").val();
		if(!modulename)
		{
			msg_warning('分类名称不能为空');
			return false;
		}
		var id = $("input[name=id]").val();
		var data = {id:id,modulename:modulename};
		send_data = {
			url:U('admin/Auth/updateCate'),
			type:'POST',
			data:data,
			dataType:'json',
		}
		send_ajax(send_data,function(res){
			if(res.status == 1){
				msg_success('修改成功','',2000);
				setTimeout(function(){
					admin.getContentByUrl(res.data.jumpurl);
				},2000);
			}else{
				msg_error(res.message);
			}
		})
	});
	$(function(){
		//调用登陆部分的js
		$(window).keyup(function(e){
			if(e.keyCode == 13){
				$(".updatecate").click();
			}
		})
	});
</script>